<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>

	<head>
		<title>系统统计-物品入库统计</title>
		<meta charset="utf-8">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>libs/bootstrap-3.3.7-dist/css/bootstrap.min.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>css/reset.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>css/style.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath %>css/iframe.css">
	</head>
	<body>
		<header id="mainHeader"></header>
		<div id="mainContent">
			<div id="mainContent_content">
			<div class="page_header"><a>物品入库统计</a></div>
				<div class="search">
					<form action="<%=basePath%>statistics/selectByWhere.do" method="post" class="form">
						<input type="hidden" name="currentPage" value="1">
						<p>
							<label>物品代码</label> 
							<input type="text" name="itemCode"	value="${itemsStorageStatisticsPage.itemCode }" class="form-control"></input>
						    <label>时间</label> <input type="text"	name="starttime" value="${itemsStorageStatisticsPage.starttime }"
							readonly
							onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="form-control"></input>
						<label>至</label> <input
							type="text" name="endtime" value="${itemsStorageStatisticsPage.endtime }"
							readonly
							onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="form-control"></input>
						<label>中文名称</label> <input type="text" name="chineseName" value="${itemsStorageStatisticsPage.chineseName }" class="form-control"></input>
						</p>
						<p>
							<label class="radio" style="width:18px;"><input name="itemsStorageStatisticsStatus" type="radio" value="0" <c:if test="${itemsStorageStatisticsPage.itemsStorageStatisticsStatus==0}">checked</c:if>/><span class="radio_icon"></span></label>普通入库
						    &nbsp;&nbsp;&nbsp;
						    <label class="radio" style="width:18px;"><input name="itemsStorageStatisticsStatus" type="radio" value="1" <c:if test="${itemsStorageStatisticsPage.itemsStorageStatisticsStatus==1}">checked</c:if>/><span class="radio_icon"></span></label>采购入库
							<span class="btn"> <input type="submit" value="搜索" class="btn btn1"></input>
							<input type="button" value="清空" onclick="clearSearchParam();" class="btn btn2"></input>
						</span>
						</p>
					</form>
				</div>
				<div class="tableBox box">
					<table class="table table-bordered table_text_center">
						<!-- 显示普通入库统计 -->
						<c:if test="${itemsStorageStatisticsPage.itemsStorageStatisticsStatus==0}">
							<thead>
								<tr>
									<th>序号</th>
									<th>物品代码</th>
									<th>物品条码 </th>
									<th>中文名称</th>
									<th>规格</th>
									<th>单位</th>
									<th>入库数量</th>
									<th>最后修改时间</th>
									<th>仓库</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${iss }" var="item" varStatus="i">
									<tr>
										<td>${i.index+1 }</td>
										<td>${item.itemCode }</td>
										<td>${item.articleBarCode }</td>
										<td>${item.chineseName }</td>
										<td>${item.purchaseSpecifications }</td>
										<td>${item.salesUnit }</td>
										<td>${item.storageQuantity }</td>
										<td>
											<fmt:formatDate value='${item.lastModifiedTime }' type='both' />
										</td>
										<td>${item.warehouseName }</td>
									</tr>
								</c:forEach>
							</tbody>
						</c:if>
						<!-- 显示采购入库统计 -->
						<c:if test="${itemsStorageStatisticsPage.itemsStorageStatisticsStatus==1}">
							<thead>
								<tr>
									<th>序号</th>
									<th>物品代码</th>
									<th>物品条码 </th>
									<th>中文名称</th>
									<th>规格</th>
									<th>单位</th>
									<th>入库数量</th>
									<th>最后修改时间</th>
									<th>仓库</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${iss2 }" var="item" varStatus="i">
									<tr>
										<td>${i.index+1 }</td>
										<td>${item.itemCode }</td>
										<td>${item.articleBarCode }</td>
										<td>${item.chineseName }</td>
										<td>${item.purchaseSpecifications }</td>
										<td>${item.salesUnit }</td>
										<td>${item.number }</td>
										<td>
											<fmt:formatDate value='${item.finalProcessingTime }' type='both' />
										</td>
										<td>${item.warehouseName }</td>
									</tr>
								</c:forEach>
							</tbody>
						</c:if>
					</table>
				</div>
				<%-- <table class="pageTable">
					<tr>
						<td style="width: 300px">
							<div>
								<h6>
								共<strong style="color: #b93d00">${itemsStorageStatisticsPage.rows }</strong>条记录
								&nbsp;当前<strong style="color: #b93d00">${itemsStorageStatisticsPage.currentPage }/${itemsStorageStatisticsPage.totalPage }</strong>页&nbsp;
								<select name="pageSize" style="width:100px;" onchange="pageSizeChange(this)">
									<option <c:if test="${itemsStorageStatisticsPage.pageSize==10 }">selected</c:if> value="10">10</option>
									<option <c:if test="${itemsStorageStatisticsPage.pageSize==20 }">selected</c:if> value="20">20</option>
									<option <c:if test="${itemsStorageStatisticsPage.pageSize==50 }">selected</c:if> value="50">50</option>
								</select>
							</h6>
							</div>
						</td>
						<td>
							<div>
								<ul class="pagination">
									<li>
										<a href="<%=basePath%>statistics/selectByWhere.do?currentPage=1">首页</a>
									</li>
									<li>
										<a href="<%=basePath%>statistics/selectByWhere.do?currentPage=${itemsStorageStatisticsPage.currentPage-1 }">上一页</a>
									</li>

									<c:forEach begin="${itemsStorageStatisticsPage.currentPage-4>0?itemsStorageStatisticsPage.currentPage-4:1 }" end="${itemsStorageStatisticsPage.currentPage+4 }" step="1" var="i">
										<c:if test="${i>0 && i<=itemsStorageStatisticsPage.totalPage }">
											<li>
												<a href="<%=basePath%>statistics/selectByWhere.do?currentPage=${i }" ${i==itemsStorageStatisticsPage.currentPage? "style='color: red'": "" }>${i}</a>
											</li>
										</c:if>
									</c:forEach>
									<li>
										<a href="<%=basePath%>statistics/selectByWhere.do?currentPage=${itemsStorageStatisticsPage.currentPage+1 }">下一页</a>
									</li>
									<li>
										<a href="<%=basePath%>statistics/selectByWhere.do?currentPage=${itemsStorageStatisticsPage.totalPage }">尾页</a>
									</li>
								</ul>
							</div>
						</td>
						<td style="width: 300px">
							<div>
								<form class="navbar-form" role="search" action="<%=basePath%>statistics/selectByWhere.do" method="post">
									<input type="text" class="form-control" name="currentPage" value="${itemsStorageStatisticsPage.currentPage }" onkeyup="limitPageNumber(this,${itemsStorageStatisticsPage.totalPage })" onchange="limitPageNumber(this,${itemsStorageStatisticsPage.totalPage })" />
									<button type="submit" class="btn btn-default">跳转</button>
								</form>
							</div>
						</td>
					</tr>
				</table> --%>
				<jsp:include page="/jsp/basic/page.jsp"></jsp:include>
			</div>
			<jsp:include page="/jsp/basic/prompt.jsp"></jsp:include>
		</div>
		<script src="<%=basePath%>js/jquery-3.2.1.min.js"></script>
		<script src="<%=basePath%>libs/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
		<script src="<%=basePath%>My97DatePickers/WdatePicker.js"></script>
		<script src="<%=basePath%>js/public.js"></script>
		<script type="text/javascript">
			//清空搜索条件
			function clearSearchParam() {
				$(".search input:text").val("");
				$(".search select").val("");
			}
		</script>
	</body>

</html>